import request from '@/config/axios'

// 标签 VO
export interface LabelVO {
  labelId: string // ID
  label: string // 名称
  projectId: string // 项目ID
  value: string // 值
}

// 标签 API
export const LabelApi = {
  // 查询标签分页
  getLabelPage: async (params: any) => {
    return await request.get({ url: `/pypm/label/page`, params })
  },

  // 查询标签详情
  getLabel: async (id: number) => {
    return await request.get({ url: `/pypm/label/get?id=` + id })
  },

  // 新增标签
  createLabel: async (data: LabelVO) => {
    return await request.post({ url: `/pypm/label/create`, data })
  },

  // 修改标签
  updateLabel: async (data: LabelVO) => {
    return await request.put({ url: `/pypm/label/update`, data })
  },

  // 删除标签
  deleteLabel: async (id: number) => {
    return await request.delete({ url: `/pypm/label/delete?id=` + id })
  },

  // 导出标签 Excel
  exportLabel: async (params) => {
    return await request.download({ url: `/pypm/label/export-excel`, params })
  }
}